import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/inspec/query_all_department_locations_entity.dart';

QueryAllDepartmentLocationsEntity $QueryAllDepartmentLocationsEntityFromJson(Map<String, dynamic> json) {
  final QueryAllDepartmentLocationsEntity queryAllDepartmentLocationsEntity = QueryAllDepartmentLocationsEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    queryAllDepartmentLocationsEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    queryAllDepartmentLocationsEntity.companyCode = companyCode;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    queryAllDepartmentLocationsEntity.hazardCode = hazardCode;
  }
  final String? hazardDepId = jsonConvert.convert<String>(json['hazardDepId']);
  if (hazardDepId != null) {
    queryAllDepartmentLocationsEntity.hazardDepId = hazardDepId;
  }
  final String? hazardDep = jsonConvert.convert<String>(json['hazardDep']);
  if (hazardDep != null) {
    queryAllDepartmentLocationsEntity.hazardDep = hazardDep;
  }
  final String? hazardLiablePersonId = jsonConvert.convert<String>(json['hazardLiablePersonId']);
  if (hazardLiablePersonId != null) {
    queryAllDepartmentLocationsEntity.hazardLiablePersonId = hazardLiablePersonId;
  }
  final String? hazardLiablePerson = jsonConvert.convert<String>(json['hazardLiablePerson']);
  if (hazardLiablePerson != null) {
    queryAllDepartmentLocationsEntity.hazardLiablePerson = hazardLiablePerson;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    queryAllDepartmentLocationsEntity.riskUnitName = riskUnitName;
  }
  final String? hazardDistinguishPersonId = jsonConvert.convert<String>(json['hazardDistinguishPersonId']);
  if (hazardDistinguishPersonId != null) {
    queryAllDepartmentLocationsEntity.hazardDistinguishPersonId = hazardDistinguishPersonId;
  }
  final String? hazardDistinguishPerson = jsonConvert.convert<String>(json['hazardDistinguishPerson']);
  if (hazardDistinguishPerson != null) {
    queryAllDepartmentLocationsEntity.hazardDistinguishPerson = hazardDistinguishPerson;
  }
  final String? hazardDistinguishDepId = jsonConvert.convert<String>(json['hazardDistinguishDepId']);
  if (hazardDistinguishDepId != null) {
    queryAllDepartmentLocationsEntity.hazardDistinguishDepId = hazardDistinguishDepId;
  }
  final String? hazardDistinguishDep = jsonConvert.convert<String>(json['hazardDistinguishDep']);
  if (hazardDistinguishDep != null) {
    queryAllDepartmentLocationsEntity.hazardDistinguishDep = hazardDistinguishDep;
  }
  final String? coordinate = jsonConvert.convert<String>(json['coordinate']);
  if (coordinate != null) {
    queryAllDepartmentLocationsEntity.coordinate = coordinate;
  }
  final String? longitude = jsonConvert.convert<String>(json['longitude']);
  if (longitude != null) {
    queryAllDepartmentLocationsEntity.longitude = longitude;
  }
  final String? latitude = jsonConvert.convert<String>(json['latitude']);
  if (latitude != null) {
    queryAllDepartmentLocationsEntity.latitude = latitude;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    queryAllDepartmentLocationsEntity.deleted = deleted;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    queryAllDepartmentLocationsEntity.createDate = createDate;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    queryAllDepartmentLocationsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    queryAllDepartmentLocationsEntity.createById = createById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    queryAllDepartmentLocationsEntity.updateDate = updateDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    queryAllDepartmentLocationsEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    queryAllDepartmentLocationsEntity.updateById = updateById;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    queryAllDepartmentLocationsEntity.riskObjectId = riskObjectId;
  }
  final String? companyId = jsonConvert.convert<String>(json['companyId']);
  if (companyId != null) {
    queryAllDepartmentLocationsEntity.companyId = companyId;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    queryAllDepartmentLocationsEntity.status = status;
  }
  final String? description = jsonConvert.convert<String>(json['description']);
  if (description != null) {
    queryAllDepartmentLocationsEntity.description = description;
  }
  final String? isDistribution = jsonConvert.convert<String>(json['isDistribution']);
  if (isDistribution != null) {
    queryAllDepartmentLocationsEntity.isDistribution = isDistribution;
  }
  final int? isUpload = jsonConvert.convert<int>(json['isUpload']);
  if (isUpload != null) {
    queryAllDepartmentLocationsEntity.isUpload = isUpload;
  }
  final dynamic children = json['children'];
  if (children != null) {
    queryAllDepartmentLocationsEntity.children = children;
  }
  final int? level = jsonConvert.convert<int>(json['level']);
  if (level != null) {
    queryAllDepartmentLocationsEntity.level = level;
  }
  final int? taskNum = jsonConvert.convert<int>(json['taskNum']);
  if (taskNum != null) {
    queryAllDepartmentLocationsEntity.taskNum = taskNum;
  }
  return queryAllDepartmentLocationsEntity;
}

Map<String, dynamic> $QueryAllDepartmentLocationsEntityToJson(QueryAllDepartmentLocationsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['hazardCode'] = entity.hazardCode;
  data['hazardDepId'] = entity.hazardDepId;
  data['hazardDep'] = entity.hazardDep;
  data['hazardLiablePersonId'] = entity.hazardLiablePersonId;
  data['hazardLiablePerson'] = entity.hazardLiablePerson;
  data['riskUnitName'] = entity.riskUnitName;
  data['hazardDistinguishPersonId'] = entity.hazardDistinguishPersonId;
  data['hazardDistinguishPerson'] = entity.hazardDistinguishPerson;
  data['hazardDistinguishDepId'] = entity.hazardDistinguishDepId;
  data['hazardDistinguishDep'] = entity.hazardDistinguishDep;
  data['coordinate'] = entity.coordinate;
  data['longitude'] = entity.longitude;
  data['latitude'] = entity.latitude;
  data['deleted'] = entity.deleted;
  data['createDate'] = entity.createDate;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['updateDate'] = entity.updateDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['riskObjectId'] = entity.riskObjectId;
  data['companyId'] = entity.companyId;
  data['status'] = entity.status;
  data['description'] = entity.description;
  data['isDistribution'] = entity.isDistribution;
  data['isUpload'] = entity.isUpload;
  data['children'] = entity.children;
  data['level'] = entity.level;
  data['taskNum'] = entity.taskNum;
  return data;
}

extension QueryAllDepartmentLocationsEntityExtension on QueryAllDepartmentLocationsEntity {
  QueryAllDepartmentLocationsEntity copyWith({
    String? id,
    String? companyCode,
    String? hazardCode,
    String? hazardDepId,
    String? hazardDep,
    String? hazardLiablePersonId,
    String? hazardLiablePerson,
    String? riskUnitName,
    String? hazardDistinguishPersonId,
    String? hazardDistinguishPerson,
    String? hazardDistinguishDepId,
    String? hazardDistinguishDep,
    String? coordinate,
    String? longitude,
    String? latitude,
    String? deleted,
    String? createDate,
    String? createBy,
    String? createById,
    String? updateDate,
    String? updateBy,
    String? updateById,
    String? riskObjectId,
    String? companyId,
    int? status,
    String? description,
    String? isDistribution,
    int? isUpload,
    dynamic children,
    int? level,
    int? taskNum,
  }) {
    return QueryAllDepartmentLocationsEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..hazardCode = hazardCode ?? this.hazardCode
      ..hazardDepId = hazardDepId ?? this.hazardDepId
      ..hazardDep = hazardDep ?? this.hazardDep
      ..hazardLiablePersonId = hazardLiablePersonId ?? this.hazardLiablePersonId
      ..hazardLiablePerson = hazardLiablePerson ?? this.hazardLiablePerson
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..hazardDistinguishPersonId = hazardDistinguishPersonId ?? this.hazardDistinguishPersonId
      ..hazardDistinguishPerson = hazardDistinguishPerson ?? this.hazardDistinguishPerson
      ..hazardDistinguishDepId = hazardDistinguishDepId ?? this.hazardDistinguishDepId
      ..hazardDistinguishDep = hazardDistinguishDep ?? this.hazardDistinguishDep
      ..coordinate = coordinate ?? this.coordinate
      ..longitude = longitude ?? this.longitude
      ..latitude = latitude ?? this.latitude
      ..deleted = deleted ?? this.deleted
      ..createDate = createDate ?? this.createDate
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..updateDate = updateDate ?? this.updateDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..companyId = companyId ?? this.companyId
      ..status = status ?? this.status
      ..description = description ?? this.description
      ..isDistribution = isDistribution ?? this.isDistribution
      ..isUpload = isUpload ?? this.isUpload
      ..children = children ?? this.children
      ..level = level ?? this.level
      ..taskNum = taskNum ?? this.taskNum;
  }
}
